home *** CD-ROM | disk | FTP | other *** search
/ Walnut Creek Sampler 1995 January / Walnut_Creek_Sampler_44_CDROMs_to_Try_Walnut_Creek_January_1995.iso / mac / MacUtils / BBEdit / BBEdit Lite 2.3.2 / BBEdit Lite QuickStart < prev    next >
Text File  |  1994-02-10  |  35KB  |  736 lines

  1. This QuickStart document provides a brief overview of some of the commands
  2. available in BBEdit Lite. For more general information about BBEdit Lite,
  3. consult the “About BBEdit Lite” document.
  4.  
  5. The topics covered in this document are:
  6.  
  7. Installation
  8. Creating and Saving Documents
  9. Editing Documents
  10. More on Wrapping
  11. Printing
  12. Searching
  13. Multi-File
  14. Searching
  15. Preferences Dialog
  16. Parting Shots
  17.  
  18. ---
  19.  
  20. Installation
  21.  
  22. BBEdit consists of the following major components:
  23.  
  24. •    The BBEdit application itself
  25. •    The “BBEdit Extensions” folder
  26.  
  27. Only the BBEdit application file is required to use BBEdit.
  28.  
  29. If you’re planning to install the whole set of BBEdit files, create a “BBEdit
  30. Folder”. Copy the BBEdit application and the “BBEdit Extensions” folder into your
  31. BBEdit Folder.
  32.  
  33. ---
  34.  
  35. Creating and Saving Documents
  36.  
  37. To create a new document within BBEdit, choose “New” from the File menu. An
  38. empty editing window will be opened on the screen. You can type in this window,
  39. paste text from another document or application, or do anything else which
  40. causes text to be placed in this window.
  41.  
  42. If you’re using System 6 or System 7, you can use the Finder to open files
  43. created by BBEdit by double-clicking on them.
  44.  
  45. Once you’ve opened a new window and done some basic editing, you can save your
  46. new document. To do this, choose the “Save As…” command from the File menu. Type
  47. in the name of your new file and click on “Save”.
  48.  
  49. ---
  50.  
  51. Editing Documents
  52.  
  53. In terms of its basic editing functionality, BBEdit behaves like any other word
  54. processor or text editor on the Macintosh: any typed characters are inserted at
  55. the insertion point; if there is a selection present, the selection is replaced
  56. by the first typed character, and the insertion point is placed after the first
  57. typed character.
  58.  
  59. The insertion point is indicated by a blinking vertical bar.
  60.  
  61. If there is any text selected in the active (or front) window, it is highlighted
  62. using your Mac’s default highlight color. If there is text selected in a window
  63. that is inactive (not the front window), it is framed in the highlight color.
  64.  
  65. As you type, BBEdit scrolls the window’s contents so that the insertion point is
  66. visible. Note that since BBEdit doesn’t automatically wrap the text as you type,
  67. the window may scroll horizontally.
  68.  
  69. (You can use James Walker’s “Text Editor Patches”, version 1.2.5 or later,
  70. to give BBEdit Lite the ability to insert carriage returns as you type.)
  71.  
  72. To move text from one place to another, select the text you wish to move, and
  73. choose the “Cut” command from the Edit menu. The selected text will be deleted,
  74. and placed in a special area called the “Clipboard”. (The Clipboard always
  75. contains the last text that you cut or copied.) You can then use the “Paste”
  76. command on the Edit menu to place the text elsewhere in the document you’re
  77. editing, or even in another window altogether. Also, any text that you cut or
  78. copy can be pasted into another application. You can place text in the Clipboard
  79. without deleting it by choosing “Copy” from the Edit menu.
  80.  
  81. When you Paste, the text that’s in the Clipboard will replace the current
  82. selection (if there is one), or be inserted at the insertion point. Paste
  83. doesn’t remove text from the Clipboard, so you can Paste as many times as you
  84. wish.
  85.  
  86. To delete selected text, hit the “Delete” key on your keyboard, or choose
  87. “Clear” from the Edit menu. If you have a keyboard with a numeric keypad on it,
  88. you can hit the “Clear” key on the keypad to delete the selected text.
  89.  
  90. To select all the text in the front editing window, choose “Select All” from the
  91. Edit menu. You can then cut, copy, or perform any other action that affects
  92. selected text.
  93.  
  94. BBEdit provides an assortment of facilities for transforming text in various
  95. ways. The commands to transform text are all found under the Text menu:
  96.  
  97. •   Balance locates the pair of parentheses, braces, or brackets which encloses
  98. the current selection range or insertion point. If there are unmatched
  99. parentheses, braces, or brackets, BBEdit will beep.
  100.  
  101. •   Twiddle transposes the two characters on either side of the insertion point,
  102. or at either end of the selected text.
  103.  
  104. Note: If you hold down the Option key, Twiddle becomes Twiddle Words. Twiddle
  105. Words behaves in similar fashion to Twiddle, except that it acts on entire
  106. words, rather than individual characters.
  107.  
  108. •   Change Case… allows you to automatically switch between upper and lower case
  109. characters for entire words, first letters of words, or first letters of lines.
  110.  
  111. •   Shift Left and Shift Right indent the selected text by one tab stop (in the
  112. case of Shift Left), or outdent by one tab stop (for Shift Right). If you hold
  113. down the Shift key while choosing one of these commands, the selected text will
  114. be indented or outdented by one space instead of one tab stop.
  115.  
  116. •   The Wrap… command is used for wrapping long lines of text and filling
  117. paragraphs. Essentially, it uses carriage returns to break lines of text, to
  118. keep them from running off to the right of your screen.
  119.  
  120. •   Unwrap… removes carriage returns and spaces between groups of text.
  121. Essentially, it performs the reverse function of the “Wrap…” command.
  122.  
  123. •   Zap Gremlins… is useful for finding and altering non-printing characters in
  124. your text files.
  125.  
  126. •   Entab converts runs of spaces into tabs, according to the current setting in
  127. the “Font and Tabs…” dialog. This transformation is useful when downloading text
  128. from a mainframe computer or on-line service which uses spaces to line up
  129. columns of text; when displaying the text in a monospaced font, columns will
  130. still usually not line up unless you Entab the text.
  131.  
  132. •   Detab converts tabs into runs of spaces, according to the current setting in
  133. the “Font and Tabs…” dialog. This is useful when uploading text to a mainframe
  134. or on-line service which has no concept of tabs as column separators.
  135.  
  136. ---
  137.  
  138. More on Wrapping
  139.  
  140. BBEdit offers the capability to wrap text in a variety of ways. This wrapping is
  141. not the “live” word wrapping that word-processors provide; instead, it is useful
  142. when importing text files from word processors or other programs that do not use
  143. carriage returns to break lines on the screen. When opened, such files appear to
  144. have only a few lines in them, which run far past the right-hand edge of the
  145. window.
  146.  
  147. To wrap text in the current document window, choose “Wrap…” from the Text menu.
  148.  
  149. The controls on the left half of the “Wrap…” dialog box control how much of the
  150. text is wrapped, and the maximum length of the lines after wrapping.
  151.  
  152. The group of radio buttons controls the length of lines after they have been
  153. wrapped:
  154.  
  155. •    The “Philip Bar” button will break lines of text at the philip bar. (To see
  156. the location of the philip bar, turn on “Show Philip Bar” in the Windows section
  157. of the Preferences dialog.) The philip bar indicates the maximum usable width of
  158. adocument window when the window is zoomed to full size on a nine-inch “classic”
  159. Macintosh screen. For this reason, you’re guaranteed that text wrapped to the
  160. philip bar will be readable without horizontal scrolling by anyone on any
  161. Macintosh.
  162.  
  163. •    If “Window Width” is selected, no wrapped line will be longer than the
  164. current width of the window. This option is useful if you’d like the lines to be
  165. alittle longer or a little shorter than is provided for by the philip bar; just
  166. size the window appropriately and wrap.
  167.  
  168. •    If “Character Width” is selected, the number in the text field designates
  169. the maximum number of characters allowed on any line; a line that exceeds this
  170. number of characters in length will be wrapped. The “Character Width” setting is
  171. useful for preparing postings to on-line services, which can break lines in an
  172. unattractive fashion if they’re longer than a fixed number of characters
  173. (usually 80).
  174.  
  175. The controls on the right half of the dialog control paragraph wrapping. If the
  176. “Paragraph Fill” check box is turned off, long lines will be wrapped. Short
  177. lines will be left untouched.
  178.  
  179. ---
  180.  
  181. Printing
  182.  
  183. BBEdit offers a variety of options for varying your printed output. These
  184. options are available from the dialog that appears when you choose “Print from
  185. the File menu:
  186.  
  187. The portion of the dialog above the gray line is the normal set of controls that
  188. is provided by whichever printer driver you use. Below the gray line are
  189. controls provided specifically by BBEdit.
  190.  
  191. •    The “Printing Font:” button will bring up a dialog that allows you to set
  192. the font, size, style, and tab attributes for the text when it’s printed (as
  193. opposed to when it’s displayed). For a description of the controls in this
  194. dialog, see the “Editing” section of this document.
  195.  
  196. •    The “Options…” button will present a dialog box for setting various
  197. formatting options, most of which should be self-explanatory.
  198.  
  199. Most of the options in “Options…” dialog only affect the appearance of the pages
  200. that are printed out, and can therefore be set according to your individual
  201. taste.
  202.  
  203. ---
  204.  
  205. Searching
  206.  
  207. BBEdit’s gives you the ability to search for strings of characters within the
  208. current document, or within multiple files, whether they’re currently open in
  209. BBEdit or not. When you choose “Find…” from the Search menu, BBEdit will present
  210. a dialog box with several options.
  211.  
  212. The edit field to the right of “Search For:” contains the string of characters
  213. that you wish to search for. If the “Grep” check box is checked, the string in
  214. this edit field is a regular expression. See below for more information on grep
  215. searching.
  216.  
  217. The edit field to the right of “Replace With:” contains the string of characters
  218. that will replace the current selection whenever you choose “Replace”, “Replace
  219. and Find Again”, or “Replace All” from the Search menu.
  220.  
  221. Note: To search for an explicit carriage return, line feed, or tab, you can
  222. type the literal character by holding down the Command key and hitting
  223. the Return or Tab key, or typing “\n” for a line feed, “\r” for a carriage
  224. return, or “\t” for a tab. You can also type Control-J, Control-M, and
  225. Control-I, respectively. To search for a -literal- occurrence of an
  226. escape (for example, in C or Rez program source), use two backslashes:
  227. “\\n”, “\\r”, and “\\t”. Also, a “\\” will be interepreted to mean a
  228. single backslash, just as it does in C.
  229.  
  230. The “Match Case” check box determines whether the search is case-sensitive or
  231. not. If “Match Case” is checked, only text which has the same combination of
  232. upper and lower case letters as the Search For string will be found.
  233.  
  234. The “Entire Word” check box determines whether the text being searched must be
  235. bounded by word breaks (spaces, dashes, and other punctuation).
  236.  
  237. The “Wrap Around” check box will cause the entire document to be searched,
  238. regardless of where the current insertion point or selection range lies.
  239. Ordinarily, only the text from the start of the selection range to the end of
  240. the document is searched. If “Wrap Around” is turned on, and the search string
  241. isn’t found between the start of the selection range and the end of the
  242. document, the search will automatically restart from the beginning of the
  243. document. If the search string is found in the document after wrapping around,
  244. BBEdit will blink the menu bar to alert you.
  245.  
  246. If the “Search Backwards” check box is checked, BBEdit will search backwards
  247. from the start of the insertion point to the start of the document, rather than
  248. forward to the end of the document. If “Wrap Around” is checked, and the search
  249. string is not found between the start of the document and the start of the
  250. selection range, the backwards search will resume from the end of the document.
  251.  
  252. Note: Unlike many word processors, BBEdit does not just search selected text;
  253. but, rather, the entire document, using the selected text or cursor location as
  254. astarting point.
  255.  
  256. After you have entered the search and replace strings and set the search options
  257. appropriately, you can click “Find”, “Don’t Find”, or “Cancel”. If you click
  258. “Find”, BBEdit will immediately search for the current search and replace
  259. strings, using the current search options. If you click “Don’t Find”, BBEdit
  260. will accept the current search strings and options, but will not perform the
  261. search; you can then choose “Find Again” from the Search menu to start the
  262. search.
  263.  
  264. ---
  265.  
  266. Multi-File Searching
  267.  
  268. BBEdit also provides a variety of means for searching through multiple text
  269. files at one time in order to locate the search string. To perform a multi-file
  270. search, check the “Multi-File Search” check box in the Find… dialog.
  271.  
  272. When you turn on “Multi-File Search”, the “Options…” button is enabled; to set
  273. up the options for a multi-file search, click this button, and a new dialog box
  274. will appear.
  275.  
  276. The popup menu next to “Search Method” in this dialog box determines how BBEdit
  277. will locate the files to be searched.
  278.  
  279. There are three ways to locate files:
  280.  
  281. •    Directory Search. When this search method is chosen, BBEdit scans through
  282. the folders starting at the one you choose, and each file that it encounters
  283. will be searched for the search string.
  284.  
  285. •    Open Windows. When you choose this search method, BBEdit searches for the
  286. search string only in document windows that are currently open. This sort of
  287. search is very fast, and may be most convenient if you wish to limit the scope
  288. of your search to a few files.
  289.  
  290. •    Search Results. This search method is only available when the “Search
  291. Results” window is open and contains the results of a previous Batch Find (see
  292. below).
  293.  
  294. The check boxes in the “Options…” dialog can be used to tailor the search to
  295. your needs:
  296.  
  297. •    Batch Find accumulates the results of the search in progress and displays
  298. them all at once in a Search Results window. If this check box is not checked,
  299. then the multi-file search will stop each time it encounters a match, and open
  300. the file that contains the match.
  301.  
  302. Once the Search Results window is opened, you can double-click on entries in the
  303. window to display any given match, or select multiple matches from different
  304. files and display them all at once.
  305.  
  306. •    Search Nested Folders causes the Directory Scan search to search folders
  307. which are enclosed in the search’s starting directory. If this check box is
  308. turned off, only the files in the starting directory will be searched.
  309.  
  310. •    Skip (…) Folders causes the Directory Scan to skip folders whose names are
  311. enclosed in parentheses. This is useful if you have folders containing text
  312. files that you do not want to search for one reason or another; just enclose the
  313. folders’ names in parentheses, and they will be skipped.
  314.  
  315. •    Search All File Types. If this check box is checked, BBEdit searches files
  316. of all kinds, regardless of whether they contain actual text or not. If it’s not
  317. checked, only text files will be searched.
  318.  
  319. After you have set the options, click “OK” to save the settings and return to
  320. the “Find…” dialog. If you then click “Find”, the multi-file search will start.
  321. If you click “Don’t Find”, the current settings will be saved, but the
  322. multi-file search won’t start until you choose “Find in Next File” from the
  323. Search menu. (If Batch Find is selected, the “Don’t Find” button is disabled.)
  324.  
  325. When BBEdit performs a multi-file search, it does so in two steps. First, it
  326. constructs a list of the files to be searched, using the search method specified
  327. in the Multi-File Search Options dialog. Second, it searches each file in the
  328. list for the search string. If “Batch Find” is selected, all occurrences in
  329. each file will be displayed in the Search Results window. Otherwise, each file
  330. will be opened to display the first occurrence of the search string; you can
  331. find subsequent occurrences of the search string in the same file by choosing
  332. “Find Again” from the Search menu. If you’re not using Batch Find, you can
  333. locate the next file that contains the search string by choosing “Find In Next
  334. File” from the Search menu.
  335.  
  336. You can combine the capabilities of BBEdit’s multi-file search with the Replace
  337. All command to perform multi-file replace operations. To do this, set up a
  338. multi-file search as desired, and un-check the “Batch Find” check box. When you
  339. return to the “Find…” dialog, click “Don’t Find”, and then choose “Find &
  340. Replace All Matches…” from the Search menu.
  341.  
  342. There are three levels of safety that are available:
  343.  
  344. •    Safest. Click on the “Leave Open” radio button. For each file that contains
  345. the search string, BBEdit will perform a “Replace All” on that file, and leave
  346. the file open so that you can inspect the changes.
  347.  
  348. •    Less Safe. Click on the “Save To Disk” radio button, and make sure that the
  349. “Confirm Saves” check box is checked. BBEdit will perform a Replace All on each
  350. file that contains the search string, and then ask you what to do.
  351.  
  352. If you click “Save”, BBEdit will save the changed file. If you click “Don’t
  353. Save”, BBEdit will throw away the changes that were just performed. If you click
  354. “Leave Open”, BBEdit will leave the file open; this is the same behavior as the
  355. “Safest” case, above. If you click “Cancel Search”, BBEdit will stop the
  356. multi-file replace operation.
  357.  
  358. •    Living on the Edge. Click on the “Save to Disk” radio button, and un-check
  359. the “Confirm Saves” check box. If you do this, BBEdit will perform a Replace All
  360. on each file that contains the search string, and then save the changed file to
  361. disk without asking. You should only use these settings if you’re absolutely
  362. certain of what you’re doing, since the changes are irreversible.
  363.  
  364. ---
  365.  
  366. Grep Searching
  367.  
  368. Grep is a method of pattern matching that derives from the Unix™ operating
  369. system.  You are probably familiar with simple pattern matching from using word
  370. processors;  when you ask a word processor to find all instances of the word
  371. "black", it is performing a simple pattern match, where each letter has to match
  372. literally.  Matching strings in this manner is not very hard.
  373.  
  374. The ability to match strings in a more general manner is both more powerful and
  375. more complicated.  It allows for sophisticated pattern matching operations, such
  376. as matching all words that begin with the letter "P" and end with the letters
  377. "er", or deleting the first word of every line.  Grep provides a powerful means
  378. of doing this.
  379.  
  380. To use Grep for searching documents, just check the “Grep” check box in the
  381. Find… dialog.
  382.  
  383. The popup menu next to the “Patterns:” in the dialog contains a list of your
  384. most commonly-used Grep patterns. You can change this list in the “Grep
  385. Patterns” section of the Preferences… dialog.
  386.  
  387. How Grep Works
  388.  
  389. The “grep” mode of searching and replacing is a powerful tool. Although somewhat
  390. slower than normal text searching, grep allows the user to search for one of a
  391. set of many strings instead of a particular string.  As a simple example, you
  392. can search for any occurrence of an identifier beginning with the letter P, or
  393. all lines that begin with a left brace.
  394.  
  395. A pattern is a string of characters that, in turn, describes a set of strings of
  396. characters.  An example of a set of strings is the set of all strings that begin
  397. with the letter P and end with the letter r;  the strings “Ptr” and “ProcPtr” are
  398. members of this set.  We say that a string is matched by a pattern if it is
  399. amember of the set described by the pattern.  Patterns are composed of
  400. sub-patterns which are patterns in themselves;  this is how complicated patterns
  401. may be formed.
  402.  
  403. The following section goes through the grep pattern matching and replacement
  404. rules step by step, so that by the end of it you should be able to understand
  405. how each of these grep patterns works and be able to make your own.
  406.  
  407. In some cases, the state of case sensitivity affects the results of a pattern
  408. match.  We have noted below when this is the case.
  409.  
  410. 1. Any character, with certain exceptions described below, is a pattern that
  411. matches itself.
  412.  
  413. 2.    A pattern x followed by a pattern y forms a pattern xy that matches any
  414. string ßµ where ß can be matched by x and µ can be matched by y.  We can, of
  415. course, take the compound pattern xy and concatenate yet another pattern z onto
  416. it, forming the pattern xyz.
  417.  
  418. 3.    The character . is a pattern that will match any character.
  419.  
  420. 4.    The character \ followed by any character except one of the digits 1-9 is
  421. a pattern that matches that character. (You would use this to find special
  422. characters, such as the . character. To search for a period, you would use \.).
  423.  
  424. 5.    A string of characters s surrounded by square brackets ([ and a ]) forms a
  425. pattern [s] that matches a single instance of one of the characters in the
  426. string s.  Note that the case sensitivity flag does not apply to characters
  427. between square brackets:  letters must match exactly.
  428.  
  429. 5a.     The pattern [^ß] matches any character that is not in the string ß.
  430. Special characters will be taken literally in this context.  Again, case
  431. sensitivity doesn't apply to characters between square brackets.
  432.  
  433. 5b.    If a string of three characters in the form [a-b] occurs in the pattern
  434. p, this represents all of the characters from a to b inclusive.  All special
  435. characters are taken literally;  i.e., [!-.] denotes the characters from ! to ..
  436. Notice that the only way to include the character ] in p is to make it the very
  437. first character.  Likewise, the only way to include the character - in p is to
  438. have it either at the very beginning or the very end of p.  Single characters
  439. and ranges may both be used between brackets.
  440.  
  441. 6a.    Any pattern p formed by any combination of rules 1 or 3-5b followed by a
  442. * forms the pattern p* that matches zero or more consecutive occurrences of
  443. characters matched by p.
  444.  
  445. 6c.    Any pattern p formed by any combination of rules 1 or 3-5b followed by a
  446. ? forms the pattern p? that matches zero or one consecutive occurrences of
  447. characters matched by p.
  448.  
  449. We now have the ability to form patterns that are composed of sub-patterns, and
  450. will find it useful to "remember" sub-strings matched by sub-patterns and to be
  451. able to match against those substrings.
  452.  
  453. 7.    A pattern surrounded by ( and ) is a pattern that matches whatever the
  454. sub-pattern matches.  This is useful for matching two or more instances of the
  455. same string and when doing replacements.
  456.  
  457. 8.    A \ followed by n, where n is one of the digits 1-9, is a pattern that
  458. matches whatever was matched by the sub-pattern beginning with the "nth"
  459. occurrence of (.  A pattern \n may be followed by an *, and forms a pattern \n*
  460. that matches zero or more occurrences of whatever \n matches.
  461.  
  462. Sometimes it is useful to be able to "constrain" patterns to match only if
  463. certain conditions in the context outside the string matched are met.
  464.  
  465. 9.    A pattern p that is preceded by a ^ forms a pattern ^p.  If the pattern ^p
  466. is not preceded by any other pattern, it matches whatever p matches as long as
  467. the first character matched by p occurs at the beginning of a line.  If the
  468. pattern ^p is preceded by another pattern, then the ^ is taken literally.
  469.  
  470. 10.    A pattern p that is followed by a $ forms a pattern p$.  If the pattern
  471. p$ is not followed by any other pattern, it matches whatever p matches as long
  472. as the last character matched by p occurs at the end of a line.  If the pattern
  473. p$ is followed by another pattern, then the $ is taken literally.
  474.  
  475. Note that the characters ^ and $ constrain pattern matches to begin or end at
  476. line boundaries, and so can be combined to constrain a pattern to match an
  477. entire line only (as in the above example).
  478.  
  479. Grep provides not only a more sophisticated method of searching, but a
  480. sophisticated method of replacing as well.  In a replacement string, the
  481. following substitutions are made before any text replacement occurs:
  482.  
  483. 1.    Each occurrence of the character & is replaced with whatever was last
  484. matched by the entire pattern.
  485.  
  486. 2.    Each occurrence of a string of the form \n, where n is one of the digits
  487. 1-9, is replaced by whatever was last matched by the sub-pattern beginning with
  488. the nth occurrence of (.
  489.  
  490. 3.    Each occurrence of a string of the form \p, where p is other than one of
  491. the digits 1-9, is replaced by p.
  492.  
  493. This allows you to not only be able to search for a string satisfying a complex
  494. set of conditions, but also to be able to do a subsequent replacement that
  495. varies depending on the string that is matched. Note that this does not take
  496. into account escape sequences, such as \t, \r, \n, \\, etc. Suppose that you
  497. have written a program that is to become a Macintosh application (i.e., it uses
  498. the Macintosh ToolBox instead of stdio for the user interface).  Suppose also
  499. that you have discovered that you have forgotten to put a \p at the beginning of
  500. your string constants, so that your program is trying to pass C strings instead
  501. of Pascal strings to the Toolbox (which only knows how to deal with Pascal
  502. strings).  You can easily change all your C strings to Pascal strings by
  503. specifying "(.*)" as the search pattern and "\\p\1" as the replacement string.
  504.  
  505. Suppose you decided to reverse the two arguments of the function "foo".  You
  506. might try the pattern foo\(([^,]*),([^)]*)\) as the search pattern and foo(\2,
  507. \1) as the replacement pattern.  How does the search pattern work?
  508.  
  509. Let's assume we're trying to match some text that looks like foo(1,*bar)
  510.  
  511.     foo\(([^,]*),([^)]*)\)    matches    foo(1,*bar)
  512.  
  513. Since ([^,]*) matched 1 and ([^)]*) matched *bar, the two arguments to foo, the
  514. replacement pattern foo(\2, \1) will result in foo(*bar, 1)
  515.  
  516. This, unfortunately, won't work in the case of foo(1,(*bar)+2), since ([^)]*)
  517. will match only up to the first right parenthesis, leaving +2) unmatched.  If
  518. we're sure that all calls to foo end with a semicolon, however, we can change
  519. our pattern to foo\(([^,]*),([^;]*)\);. In this pattern, instead of trying to
  520. match the second argument by matching everything up to the first right
  521. parenthesis, we match everything up to the ); which terminates the invocation of
  522. foo.
  523.  
  524. In this example we showed how to analyze a grep pattern by examining
  525. sub-patterns. This is a good way of figuring out how to build a pattern as well.
  526. Grep can be thought of as a small and rather cryptic programming language, with
  527. each pattern a program and sub-pattern a statement in this language. If you try
  528. to create a grep pattern by testing a small sub-pattern, then adding and testing
  529. additional sub-patterns until the complete pattern is built, you may find
  530. building complex grep patterns not nearly as daunting as you first thought.
  531.  
  532. ---
  533.  
  534. Preferences Dialog
  535.  
  536. To bring up the Preferences dialog, choose “Preferences…” from the Edit menu, or
  537. double-click on your BBEdit Prefs file. (This may not be convenient, since the
  538. BBEdit Prefs file usually resides somewhere within the System Folder.)
  539.  
  540. The popup menu next to the “Preferences” text determines which section of the
  541. preferences you’re looking at. If you click on “Save”, all of the preferences
  542. settings will be saved to the “BBEdit Prefs” file. If you click on “Cancel”, the
  543. existing preferences will be left alone, and any changes you’ve made in the
  544. Preferences settings will be discarded.
  545.  
  546.  
  547. --> The “General Preferences” settings affect BBEdit’s overall appearance and
  548. behavior.
  549.  
  550. •    MPW Compatible makes BBEdit emulate some aspects of the MPW Shell’s
  551. behavior. If it’s turned on, command-A is used for Select All, command-G for
  552. Find Again, command-H for Find Selection, command-J for Go To Line…, and command
  553. -T for Replace and Find Again. If it’s turned off, these keyboard equivalents
  554. become the same as for older versions of THINK C, with some minor changes:
  555. command-A is Find Again, command -Y is Replace and Find Again, command-T is Find
  556. In Next File, and command-G is Go To Line
  557.  
  558. The “Startup Action” radio buttons control what BBEdit does when it’s launched
  559. by some means other than double-clicking on a BBEdit document, or by dragging
  560. and dropping some item onto BBEdit itself (under System 7).
  561.  
  562. •    If Nothing is selected, BBEdit will take no action at startup. This is
  563. handy if BBEdit regularly gets launched into the background, or is launched by
  564. some scripting utility which will then start feeding commands to BBEdit
  565. directly.
  566.  
  567. •    New Window causes BBEdit to bring up a new untitled window, as if the “New
  568. command on the File menu had been chosen.
  569.  
  570. •    Open causes BBEdit to bring up an “Open…” dialog, as if the “Open…” command
  571. on the File menu had been chosen.
  572.  
  573. •    Open Several causes BBEdit to bring up the “Open Several…” dialog, as if
  574. that command had been chosen.
  575.  
  576. •    Delay When Scrolling makes BBEdit wait a tenth of a second when you click
  577. in the arrows of a scrollbar before scrolling the text in a document window.
  578. This is most useful under System 6 on faster machines; often several lines will
  579. go by before your reflexes allow you to let go of the mouse button. System 7
  580. offers a “scrolling throttle”, so this setting may be turned off.
  581.  
  582. •    Show Status Bar causes the status bar to be visible within all editing
  583. windows. (See “Editing Text With BBEdit” for a description of the status bar.)
  584. This option is on by default; you can turn it off if you have a small screen and
  585. screen “real estate” is at a premium.
  586.  
  587. •    Show Philip Bar draws a vertical gray line in the status bar at the point
  588. where the visible editing area ends on a 9-inch “classic” screen. See above for
  589. more details.
  590.  
  591. •    Show Tab Stops places tick marks in the status bar to indicate the position
  592. of tab stops in each editing window. This option is dimmed if “Show Status Bar”
  593. is turned off.
  594.  
  595. •    Show Line Numbers places line numbers along the left edge of each editing
  596. window.
  597.  
  598. •    Show Cursor Position places the cursor-position display at the lower left
  599. corner of each editing window; this display shows the position of the insertion
  600. point, or the last-changed end of the selection range.
  601.  
  602.  
  603. --> The “Editor” preferences control BBEdit’s editing and keyboard behavior.
  604.  
  605. •    The “Default Font” button sets the font which will be used to display the
  606. text in newly created windows, and for documents which have no saved state
  607. information.
  608.  
  609. •    If Auto-Indent is turned on, BBEdit will indent to the start of the
  610. preceding line whenever you type the “Return” key on the keyboard. This is
  611. useful for programmers and for reverse-indenting text. It may be less convenient
  612. if you’re using BBEdit for composing prose.
  613.  
  614. •    Wrap While Typing: generally, BBEdit does not automatically wrap text as
  615. you type it in, which means the text may scroll horizontally. Selecting this
  616. option tells BBEdit to enter carriage returns at the end of each line, according
  617. to the current “Wrap…” settings.
  618.  
  619. •    If Balance While Typing is turned on, BBEdit will flash matching
  620. parentheses, curly braces, and brackets as you type them.
  621.  
  622. •    Smart Quotes is used to determine the default value of the Smart Quotes
  623. setting for newly created windows and for documents saved with state information
  624. other than “BBEdit”.
  625.  
  626. •    Ordinarily, actions such as Entab, Detab, Zap Gremlins, and Replace All are
  627. not undoable, and BBEdit will alert you if you are about to perform a
  628. non-undoable action. If you aren’t concerned about being able to undo these
  629. actions, and don’t want BBEdit to alert you, turn on the ‘No “Can’t Undo” Alerts’
  630. check box, and BBEdit will not alert you of these actions.
  631.  
  632. •    Exchange Command and Option reverses the meaning of the Command and Option
  633. keys when used with the left and right arrow keys. See “Editing Text with
  634. BBEdit” for more details.
  635.  
  636. •    If Use Keypad for Cursor Control is checked, the keys on the numeric keypad
  637. (on keyboards that have them) will move the cursor. See “Editing Text With
  638. BBEdit” for more details.
  639.  
  640.  
  641. --> The “Printing” settings provide the default print settings for new windows
  642. and for documents which have saved state information other than BBEdit’s.
  643.  
  644. These settings correspond to the same settings on the “Options…” dialog which
  645. can be brought up from the Print… dialog.
  646.  
  647. --> The “Search Preferences” settings provide the defaults for text searching
  648. and multi-file searching. The options in this dialog correspond to their
  649. counterparts in the Find… and the Multi-File Search Options dialog.
  650.  
  651. The “Start From…” button sets the default starting directory for Directory Scan
  652. multi-file searches.
  653.  
  654. --> The “Filing Preferences” settings in this part of the Preference dialog
  655. control the default settings for the Open… and Open Several… dialogs. The
  656. “Default Saved State” popup menu determines what state information will be saved
  657. by default when you choose “Save As…” for a new window or for a file with no
  658. saved state information. If “Auto-Backup” is checked, a backup will
  659. automatically be made of afile every time it is saved.
  660.  
  661. --> The “State Preferences” settings control what parts of a file’s saved state
  662. are honored whenever a file with saved state information is opened. In some
  663. cases, it may be desirable to ignore one of these aspects of the saved state. If
  664. the “Leave Room for Finder Icons” is checked, BBEdit will make certain that
  665. there’s enough space below and to the right of any window so that icons on the
  666. desktop can be seen when you’re running under MultiFinder or System 7.
  667.  
  668. Note - if you’re running on a Macintosh with a 9-inch screen, the window sizes
  669. when “Leave Room for Finder Icons” is checked are usually too small to be 
  670. useful. Therefore, you may want to turn this option off if you have a small
  671. screen.
  672.  
  673. --> The “Wrapping Preferences” settings are the default settings for the Wrap
  674. dialog.
  675.  
  676.  
  677. --> The “Zapping Preferences” settings are the default settings for the “Zap
  678. Gremlins…” dialog.
  679.  
  680. --> The “File Types” section of the Preferences allows you to modify the list of
  681. file creators that appears in the “File Creator” popup menu of the “Save As…,
  682. Options…” dialog box.
  683.  
  684. To add a new application’s file creator to the list, click the “Add…” button,
  685. and choose the application. To change an application’s creator signature, click
  686. on an application name in the list, enter a new four-letter code in the text
  687. field next to “Creator…”, and click the “Change” button. You can use the “Set
  688. button to pick an application and enter its creator code in the text field for
  689. you. To remove an application creator from the list, click on an application
  690. name, and click the “Delete” button.
  691.  
  692. The creators for “BBEdit” and “Generic Text File” are built into BBEdit and
  693. cannot be changed or deleted.
  694.  
  695.  
  696. --> The “Grep Patterns” of the Preferences dialog allows you to modify the list
  697. of regular expressions which appears in the popup menu next to the “Grep” check
  698. box in the “Find…” dialog. The scrolling list box shows the names of the
  699. installed patterns. When you click on one, the text fields below the list will
  700. be filled in with its name, search pattern, and replace pattern. You can change
  701. any of these text fields, and click “Change” to replace the selected pattern
  702. with the changed one. You can also enter new information in the text fields and
  703. click “Add” to add a new pattern, or select a pattern and click “Delete” to
  704. remove it from the list.
  705.  
  706. Note: You can install a pattern with an empty replace pattern, which is useful
  707. just for locating text which matches a particular regular expression.
  708.  
  709. ---
  710.  
  711. Parting Shots
  712.  
  713. Be sure to look at the “About BBEdit Lite” document which comes with the BBEdit
  714. Lite software. For more information about BBEdit or BBEdit Lite, or to offer bug
  715. reports or suggestions for future versions, feel free to write:
  716.  
  717. Bare Bones Software
  718. c/o R. Siegel
  719. 1 Larkspur Way, #4
  720. Natick, MA  01760
  721.  
  722. or, by e-mail:
  723.  
  724. bbedit@world.std.com    [internet]
  725. 73051,3255                [CompuServe]
  726. BARE.BONES                [AppleLink]
  727.  
  728. or, by phone or fax:
  729.  
  730. (508) 651-3561            [phone]
  731. (508) 651-7584            [fax]
  732.  
  733. This document was written by Allan Rousselle, with assistance from Rich
  734. Siegel. This document and the BBEdit Lite application are copyright
  735. ©1992-1994 Richard M. Siegel, all rights reserved.
  736.